<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>    
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=path %>/jquery-easyui-1.4.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/jquery-easyui-1.4.3/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/jquery-easyui-1.4.3/demo/demo.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/dist/css/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/dist/css/flat-ui.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/docs/assets/css/demo.css">
<link rel="shortcut icon" href="<%=path %>/img/favicon.ico">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="<%=path %>/dist/js/vendor/html5shiv.js"></script>
  <script src="<%=path %>/dist/js/vendor/respond.min.js"></script>
<![endif]-->
    
<script type="text/javascript" src="<%=path %>/jquery-easyui-1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="<%=path %>/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyUI.dateFormatter.js"></script>
<script type="text/javascript" src="<%=path %>/js/Jquery.dateFormatter.js"></script>


    <script type="text/javascript" src="<%=path %>/dist/js/flat-ui.min.js"></script>
    <script type="text/javascript" src="<%=path %>/docs/assets/js/application.js"></script>
<title>API_MANAGER</title>
    
</head>


<body>
<jsp:include page="/common/head.jsp"></jsp:include>
	
	<form action="<%=path%>/loginAction!index" id="from1" method="post">
<div class="container">
	<div class="login">
        <div class="login-screen">
          <div class="login-icon">
            <img src="<%=path%>/img/icons/svg/clipboard.svg" alt="WELCOME TO APP MANAGER" />
            <h4><small>API MANAGER</small></h4>
          </div>

          <div class="login-form">
            <div class="form-group">
              <input type="text" class="form-control login-field" value="" placeholder="用户名" id="username" />
              <label class="login-field-icon fui-user" for="username"></label>
            </div>

            <div class="form-group">
              <input type="password" class="form-control login-field" value="" placeholder="密码" id="password" />
              <label class="login-field-icon fui-lock" for="password"></label>
            </div>

            <a class="btn btn-primary btn-lg btn-block" href="javascript:void(0)" id="btn">登录</a>
			<div style="color:#E74C3C" id="message"></div>
          </div>
        </div>
      </div>
</div>      
	</form>
      

<script type="text/javascript">
$(document).ready(function(){
	$("#userdiv").css('display','none');
	$("#btn").click(function(){
		var username = $("#username").val();
		var password = $("#password").val();
		if(username == '' || password == ''){
			$("#message").html('<h5>用户名或密码不能为空</h5>');
			return false;
		}
		$.post("<%=path%>/loginAction!chkname",{'user.loginName':username,'user.loginPwd':password},function(result){
		    if(result == 'success'){
		    	window.location.href="<%=path%>/projAction!gotolist";
		    }else{
		    	$("#message").html('<h5>用户名或密码错误</h5>');
		    }
		},"text");
	});
	
	document.onkeydown=function(){
        if (event.keyCode == 13){
        	$("#btn").click();
        }        
       }
});
</script>
</body>
</html>